/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sunsite.service;

import java.util.List;
import org.springframework.dao.DataAccessException;
import sunsite.dao.MessageDao;
import sunsite.po.Message;

/**
 *
 * @author mg
 */
public class MessageServiceImpl implements MessageService{
    private MessageDao messageDao;

    public void setMessageDao(MessageDao messageDao) {
        this.messageDao = messageDao;
    }

    public void addMessage(Message m) throws DataAccessException {
        messageDao.addMessage(m);
    }

    public List<Message> getMessage(int pageNow) throws DataAccessException {
        return messageDao.getMessages(pageNow);
    }

    public int getMessagePages() throws DataAccessException {
        return messageDao.getPageCount();
    }

}
